/**
 * Created by ying on 16-9-12.
 */
function Item(item,classification,name,price,unit,count){
    this.classification=item.classification;
    this.name=item.name;
    this.price=item.price;
    this.unit=item.unit;
    this.count=item.count;
}

Item.prototype.get_subtotal=function(goods_info){
    goods_info[this.name].actually=(goods_info[this.name].count-goods_info[this.name].pro_count)*goods_info[this.name].price;
    if(goods_info[this.name].pro_count==0){
        goods_info[this.name].original='';
    }else{
        goods_info[this.name].original=goods_info[this.name].count*goods_info[this.name].price;
    }
    return goods_info;
}

Item.prototype.change_count=function(new_count,goods_info,item){
    this.count=new_count;
    goods_info[item.name].count=this.count;
    return goods_info;
}
